import React, { PureComponent, Fragment } from 'react';
import {
  Form,
  Drawer,
  Col, Row,
} from 'antd';


@Form.create()
class UpdateForm extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      iconList: [],
    };
    this.formLayout = {
      labelCol: { span: 7 },
      wrapperCol: { span: 13 },
    };
  }

  //弹窗
  render() {
    const { bidInfoView, handleStateClick, bidInfo } = this.props;
    console.log(232323, bidInfo);
    let data = {
      ...bidInfo.msg.borrower,
      ...bidInfo.msg.introduce,
      brandInfo: bidInfo.msg.brandInfo,
    };
    const DescriptionItem = ({ title, content }) => (
      <div
        style={{
          fontSize: 14,
          lineHeight: '22px',
          marginBottom: 7,
          color: 'rgba(0,0,0,0.65)',
        }}
      >
        <p
          style={{
            marginRight: 8,
            display: 'inline-block',
            color: 'rgba(0,0,0,0.85)',
          }}
        >
          {title}:
        </p>
        {content}
      </div>
    );

    return (<Drawer
      width={640}
      placement="right"
      closable={false}
      onClose={() => handleStateClick(false, [])}
      visible={bidInfoView}
    >
      <Row>
        <Col span={12}>
          <DescriptionItem title="项目名称" content={data.projectName}/>
        </Col>
      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="品牌介绍" content={data.brandInfo}/>{' '}
        </Col>
        <Col span={12}>
          <DescriptionItem title="借款人信息" content={data.borrower}/>
        </Col>
      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="借款用途" content={data.loanUsage}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="相关费用" content={data.relateFee}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="项目介绍" content={data.introduce}/>
        </Col>

      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="保障措施" content={data.safeGuard}/>
        </Col>
      </Row>
      <Row>

        <Col span={24}>
          <DescriptionItem title="还款来源" content={data.repaySource}/>
        </Col>
      </Row>


      <Row>
        <Col span={24}>
          <DescriptionItem title="募集期" content={data.raiseDate}/>
        </Col>

      </Row>

      <Row>
        <Col span={12}>
          <DescriptionItem title="项目编号" content={data.projectNo}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="借款人类型" content={data.borrowType}/>
        </Col>
      </Row>

      <Row>
        <Col span={12}>
          <DescriptionItem title="借款企业" content={data.enterpriseName}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="信用代码" content={data.creditCode}/>
        </Col>
      </Row>

      <Row>
        <Col span={12}>
          <DescriptionItem title="法人" content={data.legal}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="注册资本(万元)" content={data.capital}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="经营范围" content={data.scope}/>
        </Col>
      </Row>
      <Row>

        <Col span={12}>
          <DescriptionItem title="成立时间" content={data.buildTime}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="注册地址" content={data.address}/>
        </Col>
      </Row>
      <Row>

        <Col span={24}>
          <DescriptionItem title="办公地点" content={data.workSpace}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="主营业务" content={data.operation}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="经营区域" content={data.managementArea}/>
        </Col>
      </Row>
      <Row>

        <Col span={12}>
          <DescriptionItem title="行业" content={data.industry}/>
        </Col>
      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="从业年限" content={data.entirePeriod}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="累计借款笔数" content={data.borrowTimes}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem title="股东信息" content={data.shareHolder}/>
        </Col>

      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="累计借款额" content={data.borrowAmount}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="逾期次数" content={data.overdueTimes}/>
        </Col>
      </Row>
      <Row>
        <Col span={12}>
          <DescriptionItem title="逾期金额" content={data.overdueAmount}/>
        </Col>
        <Col span={12}>
          <DescriptionItem title="代还金额" content={data.repaymentAmount}/>
        </Col>
      </Row>
      <Row>
        <Col span={24}>
          <DescriptionItem
            title="其他借款情况"
            content={data.other}
          />
        </Col>
      </Row>

    </Drawer>);

  }
}

export default UpdateForm;
